package ch.sfug.text.util {
	import flash.text.TextField;	import flash.text.TextFormat;	
	public class TextStyleUtils {
		public static function setSpacesWidth( txt_f:TextField = null, space:Number = 1 ):void {
			
			var space_tf:TextFormat = new TextFormat();
			space_tf.letterSpacing = space;
			
			var text_split = txt_f.text.split(" ");
			
			var i:int = 0;
						
			while (txt_f.text.indexOf(" ", i) > -1) {
				var index = txt_f.text.indexOf(" ", i);
			    
				txt_f.setTextFormat(space_tf, index, index + 1);
			    
				i = index + 1;
			}
		}

		
		public static function setLeading( txt_f:TextField = null, space:Number = 0  ):void {
			var tf:TextFormat = txt_f.getTextFormat();
			tf.leading = space;			
			txt_f.setTextFormat(tf);
		}
	}
}